package com.scorpios.springbootdemo.controller;

import org.springframework.stereotype.Component;
import org.springframework.web.HttpRequestHandler;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@Component("/login")
public class LoginController implements HttpRequestHandler {
    // 静态资源的请求，用的是SimpleUrlHandlerMapping
    @Override
    public void handleRequest(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws ServletException, IOException {
        System.out.println("login...HttpRequestHandler");
        System.out.println("实现 HttpRequestHandler 方式所使用的HandlerMapping：BeanNameUrlHandlerMapping，\n" +
                "实现 HttpRequestHandler 方式所使用的适配器：HttpRequestHandlerAdapter");
    }
}
